lunorules = { }

----------------------------------------------------------------------------------------------
minetest.register_on_joinplayer(function(player)
	if player ~= nil and player:is_player() then
		minetest.after(1, function()
			--[[
			minetest.chat_send_player(player:get_player_name(), "REGRAS DO SERVIDOR CRAFTOPOLES")
			minetest.chat_send_player(player:get_player_name(), " 1o - Proibido destruir ou sujar construcoes de outros jogadores.")
			minetest.chat_send_player(player:get_player_name(), " 2o - Recolha seus recursos basicos em uma caverna de mineracao especifica do jogo.")
			minetest.chat_send_player(player:get_player_name(), " 3o - Se desmatar uma arvore replante outra no mesmo lugar.")
			minetest.chat_send_player(player:get_player_name(), " 4o - So podera construir se demonstrar ao moderador que conhece e concorda com as regras.")
			]]--
		
			--minetest.sound_play("sound_wellcome", {pos=player.pos, max_hear_distance = 5})
			minetest.sound_play("sound_wellcome", {
				object = player,
				gain = 1.0,
				max_hear_distance = 1000.0,
				loop = false,
			})
		end)
	end
end)
----------------------------------------------------------------------------------------------
--minetest.register_on_generated(function(minp, maxp, seed)
--	local debug = "minp="..(minetest.pos_to_string(minp))..", maxp="..(minetest.pos_to_string(maxp))..", seed="..seed
--	print(debug)
--	minetest.chat_send_all(debug)
--end)
----------------------------------------------------------------------------------------------

-- FONTE: http://codepad.org/ElnMjf5y/fork
----------------------------------------------------------------------------------------------

lunorules.showARegras = function(name)
	minetest.chat_send_player(name, "    ", false)
	minetest.chat_send_player(name, "################################################################################################", false)
	minetest.chat_send_player(name, "### REGRAS DO SERVIDOR CRAFTOPOLES", false)
	minetest.chat_send_player(name, "################################################################################################", false)
	minetest.chat_send_player(name, "###  1o - Proibido destruir ou sujar construcoes de outros jogadores.", false)
	minetest.chat_send_player(name, "###  2o - Recolha seus recursos basicos em uma caverna de mineracao especifica de cada cidade.", false)
	minetest.chat_send_player(name, "###  3o - Se desmatar uma arvore replante outra no mesmo lugar.", false)
	minetest.chat_send_player(name, "###  4o - So podera construir se demonstrar ao moderador que conhece e concorda com as regras.", false)
	minetest.chat_send_player(name, "################################################################################################", false)
	minetest.chat_send_player(name, name..", precione F10 e use a rolagem do mouse para ler todo este testo!!!", false)
end


minetest.register_chatcommand("regras", {
	params = "",
	description = "Exibe as regras deste servidor.",
	privs = {},
	func = function(name, param)
		lunorules.showARegras(name)
	end,
})

minetest.register_chatcommand("lunorules", {
	params = "",
	description = "Exibe as regras deste servidor.",
	privs = {},
	func = function(name, param)
		lunorules.showARegras(name)
	end,
})


